package cn.wen233.sunglow.controllers;

import cn.wen233.basic.http.RestResponse;
import cn.wen233.core.page.PageIn;
import cn.wen233.core.service.NodeRecordService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 节点注册记录 api
 *
 * @author wenjie
 * @date 2022-05-07 13:19
 */
@RestController
@RequestMapping("/node-record")
@RequiredArgsConstructor
public class NodeRecordApi {

    private final NodeRecordService nodeRecordService;

    @PostMapping
    public RestResponse<?> getAll(@RequestBody PageIn pageIn) {
        pageIn.setNumber(pageIn.getNumber() - 1);
        return RestResponse.success(nodeRecordService.findPage(pageIn));
    }
}
